package com.hangxingliu.exceltools;

import javax.swing.AbstractButton;
import javax.swing.UIManager;

import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;
import org.jb2011.lnf.beautyeye.ch3_button.BEButtonUI;
import org.jb2011.lnf.beautyeye.ch3_button.BEButtonUI.NormalColor;

public class UserInterfaceThemeLoader {

	public static boolean Load() {
		try {
			// Hide setting button on the title bar
			UIManager.put("RootPane.setupButtonVisible", false);
			
			BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;
			
	        org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
	        
			
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
		return true;
	}
	
	public static void NormalButton(AbstractButton button) {
		BEButtonUI ui = new BEButtonUI();
		ui.setNormalColor(NormalColor.normal);
		button.setUI(ui);
	}
	public static void SuccessButton(AbstractButton button) {
		button.setUI(new BEButtonUI().setNormalColor(NormalColor.green));
	}
	public static void InfoButton(AbstractButton button) {
		button.setUI(new BEButtonUI().setNormalColor(NormalColor.lightBlue));
	}
	public static void PrimaryButton(AbstractButton button) {
		button.setUI(new BEButtonUI().setNormalColor(NormalColor.blue));
	}
	public static void DangerButton(AbstractButton button) {
		button.setUI(new BEButtonUI().setNormalColor(NormalColor.red));
	}
}
